package org.neuedu.chapter09_0629.demo06;

import java.util.Arrays;

public class StringDemo02 {
    public static void main(String[] args) {
        String str1 = "hello";
        String str2 = "Hello";
        // 比较内容方法
        // boolean equals
        // boolean equalsIgnoreCase
        System.out.println(str1.equals(str2));// false
        System.out.println(str1.equalsIgnoreCase(str2));// true
        // char charAt(int index) 返回指定索引处字符
        System.out.println(str1.charAt(0));
        // char[] toCharArray() 返回 字符 数组
        char[] chars = str1.toCharArray();
        System.out.println(Arrays.toString(chars));
        // 将 字符数组 转成 String
        char[] arr = {'j', 'a', 'v', 'a', '7'};
        String str3 = new String(arr);
        System.out.println(str3);
    }
}
